﻿using Microsoft.AspNetCore.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VoL.Domain.Infrastructure
{
    public class ChatHub:Hub
    {
        /// <summary>
        /// 接收前端消息，并发送给连接的全部用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public async Task SendMessage()
        {
            //可以加缓存，存储用户信息和对应的连接Id
            await Clients.All.SendAsync("MessageInfo", "您有新的未读医嘱消息!");
        }
    }
}
